#include "TaskPlan.h"

namespace BroodWar
{
	namespace Addon
	{
		TaskPlan^ ConvertTaskPlan(BWSAL::TaskPlan plan)
		{
			return gcnew TaskPlan(plan);
		}

		BWSAL::TaskPlan ConvertTaskPlan(TaskPlan^ plan)
		{
			return *(plan->instance);
		}

		TaskPlan::TaskPlan(BWSAL::TaskPlan plan)
		{
			instance = new BWSAL::TaskPlan(plan);
		}

		TaskPlan::~TaskPlan()
		{
			delete instance;
		}

		TaskPlan::!TaskPlan()
		{
			delete instance;
		}
		
		int TaskPlan::RunTime::get()
		{
			return instance->getRunTime();
		}

		BuildUnit^ TaskPlan::Builder::get()
		{
			return ConvertBuildUnit(instance->getBuilder());
		}

		BuildUnit^ TaskPlan::SecondBuilder::get()
		{
			return ConvertBuildUnit(instance->getSecondBuilder());
		}
	}
}
